@echo off

:
: Build camera module
:
echo =========================
echo      Building Module
echo =========================
t:
if exist T:\epoc32\release\gcce\urel\kf__camera.pyd del T:\epoc32\release\gcce\urel\kf__camera.pyd
if exist T:\EPOC32\BUILD\pys60src\ext\amaretto\camera\group\_CAMERA\GCCE\urel\cameramodule.o del T:\EPOC32\BUILD\pys60src\ext\amaretto\camera\group\_CAMERA\GCCE\urel\cameramodule.o
if exist T:\EPOC32\BUILD\pys60src\ext\amaretto\camera\group\_CAMERA\GCCE\urel\takephoto.o    del T:\EPOC32\BUILD\pys60src\ext\amaretto\camera\group\_CAMERA\GCCE\urel\takephoto.o
cd t:\pys60src\ext\amaretto\camera\group
set EPOCROOT=\
REM ~ call bldmake bldfiles
REM ~ call abld build gcce urel
REM ~ call abld freeze gcce
call abld build gcce urel
if not exist T:\epoc32\release\gcce\urel\kf__camera.pyd goto ERROR
copy T:\epoc32\release\gcce\urel\kf__camera.pyd     "C:\Program Files\PythonForS60\module-repo\dev-modules\camera2\kf__camera2.pyd"
copy T:\pys60src\ext\amaretto\camera\src\camera2.py "C:\Program Files\PythonForS60\module-repo\dev-modules\camera2\"

:
: Build SIS file
:
echo =========================
echo     Building SIS file
echo =========================
i:
if not exist camera2         md camera2
if not exist camera2\sys     md camera2\sys
if not exist camera2\sys\bin md camera2\sys\bin
if not exist camera2\resource           md camera2\resource
if not exist camera2\resource\Python25  md camera2\resource\Python25

if exist camera2\sys\bin\kf__camera2.pyd    del camera2\sys\bin\kf__camera2.pyd
copy T:\epoc32\release\gcce\urel\kf__camera.pyd camera2\sys\bin\kf__camera2.pyd

if exist camera2\resource\Python25\camera2.py   del camera2\resource\Python25\camera2.py
copy T:\pys60src\ext\amaretto\camera\src\camera2.py camera2\resource\Python25\camera2.py

if exist camera2_v*.sis del camera2_v*.sis
c:
cd "C:\Program Files\PythonForS60"
ensymble.py simplesis --version=0.0.1 --drive=C i:camera2 i:
i:
goto END

:ERROR
echo Error building module!

:
:END
: